<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>1.下列关于前后端通信的概念，说法不正确的是？（选择一项） |  zfy的个人博客</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="./img/Scorpio.png">
    <link rel="stylesheet" href="./css/style.css">
    <meta name="description" content="My tech blog">
    
    <link rel="preload" href="./assets/css/0.styles.cfdaa54c.css" as="style"><link rel="preload" href="./assets/js/app.7878252f.js" as="script"><link rel="preload" href="./assets/js/2.877879cc.js" as="script"><link rel="preload" href="./assets/js/95.076b06fb.js" as="script"><link rel="prefetch" href="./assets/js/10.a489e96f.js"><link rel="prefetch" href="./assets/js/11.f6f26a2f.js"><link rel="prefetch" href="./assets/js/12.8a827e29.js"><link rel="prefetch" href="./assets/js/13.e420b04a.js"><link rel="prefetch" href="./assets/js/14.52f00cc6.js"><link rel="prefetch" href="./assets/js/15.ef68d553.js"><link rel="prefetch" href="./assets/js/16.c2999dfd.js"><link rel="prefetch" href="./assets/js/17.0adb748c.js"><link rel="prefetch" href="./assets/js/18.2c077020.js"><link rel="prefetch" href="./assets/js/19.013b5e02.js"><link rel="prefetch" href="./assets/js/20.bb3b854e.js"><link rel="prefetch" href="./assets/js/21.28efc78c.js"><link rel="prefetch" href="./assets/js/22.4a1d71dd.js"><link rel="prefetch" href="./assets/js/23.605a5451.js"><link rel="prefetch" href="./assets/js/24.66bf035d.js"><link rel="prefetch" href="./assets/js/25.fbe72655.js"><link rel="prefetch" href="./assets/js/26.3f374d1f.js"><link rel="prefetch" href="./assets/js/27.556ea617.js"><link rel="prefetch" href="./assets/js/28.0cab868b.js"><link rel="prefetch" href="./assets/js/29.564f8747.js"><link rel="prefetch" href="./assets/js/3.4cfb1b9c.js"><link rel="prefetch" href="./assets/js/30.c4a099d1.js"><link rel="prefetch" href="./assets/js/31.7fbc3d2a.js"><link rel="prefetch" href="./assets/js/32.8f356b20.js"><link rel="prefetch" href="./assets/js/33.b5a1b0bb.js"><link rel="prefetch" href="./assets/js/34.57086c2e.js"><link rel="prefetch" href="./assets/js/35.2b4d0231.js"><link rel="prefetch" href="./assets/js/36.a99f6d64.js"><link rel="prefetch" href="./assets/js/37.eb25dcef.js"><link rel="prefetch" href="./assets/js/38.e45d8594.js"><link rel="prefetch" href="./assets/js/39.213e3a72.js"><link rel="prefetch" href="./assets/js/4.b86a0fbe.js"><link rel="prefetch" href="./assets/js/40.cadafdd6.js"><link rel="prefetch" href="./assets/js/41.23b0f26d.js"><link rel="prefetch" href="./assets/js/42.7c2b83c6.js"><link rel="prefetch" href="./assets/js/43.62f328ea.js"><link rel="prefetch" href="./assets/js/44.c4dfbd34.js"><link rel="prefetch" href="./assets/js/45.cde5bb22.js"><link rel="prefetch" href="./assets/js/46.6c62bdb8.js"><link rel="prefetch" href="./assets/js/47.4857766a.js"><link rel="prefetch" href="./assets/js/48.55a0cccc.js"><link rel="prefetch" href="./assets/js/49.3dceda91.js"><link rel="prefetch" href="./assets/js/5.13776f82.js"><link rel="prefetch" href="./assets/js/50.ab4d52fa.js"><link rel="prefetch" href="./assets/js/51.69ccc35a.js"><link rel="prefetch" href="./assets/js/52.01f3f711.js"><link rel="prefetch" href="./assets/js/53.c146a1ff.js"><link rel="prefetch" href="./assets/js/54.71ce70c2.js"><link rel="prefetch" href="./assets/js/55.98ef481d.js"><link rel="prefetch" href="./assets/js/56.b23daa51.js"><link rel="prefetch" href="./assets/js/57.6aa314ad.js"><link rel="prefetch" href="./assets/js/58.7d6367d9.js"><link rel="prefetch" href="./assets/js/59.88894cf5.js"><link rel="prefetch" href="./assets/js/6.93d89692.js"><link rel="prefetch" href="./assets/js/60.111f9a04.js"><link rel="prefetch" href="./assets/js/61.add82aab.js"><link rel="prefetch" href="./assets/js/62.8bfac830.js"><link rel="prefetch" href="./assets/js/63.db44a5ca.js"><link rel="prefetch" href="./assets/js/64.0244f0ef.js"><link rel="prefetch" href="./assets/js/65.2be994de.js"><link rel="prefetch" href="./assets/js/66.c5066e37.js"><link rel="prefetch" href="./assets/js/67.c11b474b.js"><link rel="prefetch" href="./assets/js/68.276bdc3e.js"><link rel="prefetch" href="./assets/js/69.f5f39d50.js"><link rel="prefetch" href="./assets/js/7.ca9f7e96.js"><link rel="prefetch" href="./assets/js/70.e3ca02b0.js"><link rel="prefetch" href="./assets/js/71.befcf8f7.js"><link rel="prefetch" href="./assets/js/72.04fabafd.js"><link rel="prefetch" href="./assets/js/73.e5b707f2.js"><link rel="prefetch" href="./assets/js/74.b5668150.js"><link rel="prefetch" href="./assets/js/75.eb7cfac9.js"><link rel="prefetch" href="./assets/js/76.c1b76370.js"><link rel="prefetch" href="./assets/js/77.5875e953.js"><link rel="prefetch" href="./assets/js/78.a5e2fa5b.js"><link rel="prefetch" href="./assets/js/79.eb2d51a7.js"><link rel="prefetch" href="./assets/js/8.570c39ea.js"><link rel="prefetch" href="./assets/js/80.7252ac50.js"><link rel="prefetch" href="./assets/js/81.eb980d26.js"><link rel="prefetch" href="./assets/js/82.9e069d8f.js"><link rel="prefetch" href="./assets/js/83.8c5a6dc6.js"><link rel="prefetch" href="./assets/js/84.26baaa09.js"><link rel="prefetch" href="./assets/js/85.96bc7e77.js"><link rel="prefetch" href="./assets/js/86.9c9dd1ca.js"><link rel="prefetch" href="./assets/js/87.d54639b8.js"><link rel="prefetch" href="./assets/js/88.3d3ae1e1.js"><link rel="prefetch" href="./assets/js/89.a81caa83.js"><link rel="prefetch" href="./assets/js/9.7a58df3d.js"><link rel="prefetch" href="./assets/js/90.c3c347ed.js"><link rel="prefetch" href="./assets/js/91.b6240032.js"><link rel="prefetch" href="./assets/js/92.8331718a.js"><link rel="prefetch" href="./assets/js/93.ca174cfa.js"><link rel="prefetch" href="./assets/js/94.fec3300c.js"><link rel="prefetch" href="./assets/js/96.8ed8b32f.js">
    <link rel="stylesheet" href="./assets/css/0.styles.cfdaa54c.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/./" class="home-link router-link-active"><!----> <span class="site-name"> zfy的个人博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>CSS</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Javascipt</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML&amp;CSS练习</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Javascipt练习</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/./guide/notes/jswork/01-认识javascript.html" class="sidebar-link">01-认识javaScript</a></li><li><a href="/./guide/notes/jswork/02-变量与数据类型.html" class="sidebar-link">02-变量与数据类型</a></li><li><a href="/./guide/notes/jswork/03-DOM.html" class="sidebar-link">03-DOM</a></li><li><a href="/./guide/notes/jswork/04-表达式和操作符.html" class="sidebar-link">04-表达式和操作符</a></li><li><a href="/./guide/notes/jswork/05-判断.html" class="sidebar-link">05-判断</a></li><li><a href="/./guide/notes/jswork/06-循环.html" class="sidebar-link">06-循环</a></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>07-暂无</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/./guide/notes/jswork/08-函数.html" class="sidebar-link">08-函数</a></li><li><a href="/./guide/notes/jswork/09-案例.html" class="sidebar-link">09-案例</a></li><li><a href="/./guide/notes/jswork/10-数组.html" class="sidebar-link">10-数组</a></li><li><a href="/./guide/notes/jswork/11-字符串.html" class="sidebar-link">11-字符串</a></li><li><a href="/./guide/notes/jswork/12-DOM.html" class="sidebar-link">12-DOM</a></li><li><a href="/./guide/notes/jswork/13-浏览器操作.html" class="sidebar-link">13-BOM</a></li><li><a href="/./guide/notes/jswork/14-面向project.html" class="sidebar-link">14-面向对象</a></li><li><a href="/./guide/notes/jswork/15-Js阶段测试组卷.html" class="sidebar-link">15-Js阶段测试组卷</a></li><li><a href="/./guide/notes/jswork/16-模板字符串箭头函数变量声明.html" class="sidebar-link">16-模板字符串箭头函数变量声明</a></li><li><a href="/./guide/notes/jswork/17-解构赋值.html" class="sidebar-link">17-解构赋值</a></li><li><a href="/./guide/notes/jswork/18-project字面量增强和函数默认参数.html" class="sidebar-link">18-对象字面量增强和函数默认参数</a></li><li><a href="/./guide/notes/jswork/19-剩余参数和数组展开.html" class="sidebar-link">19-剩余参数和数组展开</a></li><li><a href="/./guide/notes/jswork/20-Map Set.html" class="sidebar-link">20-Map Set</a></li><li><a href="/./guide/notes/jswork/21-iterator和for...of循环.html" class="sidebar-link">21-iterator和for...of循环</a></li><li><a href="/./guide/notes/jswork/22-Promise和class.html" class="sidebar-link">22-Promise和class</a></li><li><a href="/./guide/notes/jswork/23-module.html" class="sidebar-link">23-module</a></li><li><a href="/./guide/notes/jswork/24-ES6测评题目.html" class="sidebar-link">24-ES6测评题目</a></li><li><a href="/./guide/notes/jswork/25-本地存储和http.html" class="active sidebar-link">25-本地存储和http</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/./guide/notes/jswork/26-ajax选择题.html" class="sidebar-link">26-ajax选择题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h3 id="_1-下列关于前后端通信的概念-说法不正确的是-选择一项"><a href="#_1-下列关于前后端通信的概念-说法不正确的是-选择一项" class="header-anchor">#</a> 1.下列关于前后端通信的概念，说法不正确的是？（选择一项）</h3> <p><strong>A.</strong> 前后端通信指的是前端和后端数据交互的过程</p> <p>**B.**常见的前后端通信的过程是：服务器向浏览器请求数据，浏览器向服务器响应数据</p> <p>**C.**能和服务器通信的就叫客户端</p> <p>**D.**浏览器和服务器之间的数据交互过程属于前后端通信</p> <p><strong>本题考查前后端通信概念。</strong></p> <p>常见的前后端通信的过程是：浏览器向服务器请求数据，服务器向浏览器响应数据。所以B选项说法是错误的。</p> <p>本题选择不正确的项，<strong>所以答案为B。</strong></p> <h3 id="_2-浏览器在解析下面哪一个标签时-会向服务器发送请求-选择两项"><a href="#_2-浏览器在解析下面哪一个标签时-会向服务器发送请求-选择两项" class="header-anchor">#</a> 2.浏览器在解析下面哪一个标签时，会向服务器发送请求？（选择两项）</h3> <p><strong>A.</strong> <img></p> <p><strong>B.</strong></p><form></form><p></p> <p><strong>C.</strong><a></a></p> <p><strong>D.</strong><script></script></p> <p><strong>本题考查特殊标签的使用。</strong></p> <p>浏览器在解析 HTML 标签的时候，遇到link、img、script、iframe标签，会再次向服务器发送请求。</p> <p>而a、form标签在浏览器解析的时候，不会向服务器发送请求，但是用户可以使用它们向服务器发送请求。例如，可以在form标签中填写数据，点击提交按钮，从而向服务器发起请求。</p> <p><strong>所以答案为A、D。</strong></p> <h3 id="_3-下面关于http相关概念-说法错误的是-选择一项"><a href="#_3-下面关于http相关概念-说法错误的是-选择一项" class="header-anchor">#</a> 3.下面关于HTTP相关概念，说法错误的是？（选择一项）</h3> <p><strong>A.</strong> HTTP是超文本传输协议</p> <p>**B.**HTML、JS、CSS等文件，都是通过 HTTP在服务器和浏览器之间传输</p> <p><strong>C.</strong> 浏览器在请求某一个地址时，会直接向服务器发起HTTP请求</p> <p>**D.**浏览器和服务器之间，通过TCP连接</p> <p><strong>本题考查HTTP相关概念。</strong></p> <p>浏览器在请求某一个地址时，会先在缓存中查找是否访问过此地址。如果访问过，则不会像服务器发送HTTP请求了。所以C选项说法是错误的。</p> <p><strong>本题选择错误的项，答案为C</strong></p> <h3 id="_4-下列关于http报文-说法错误的是-选择一项"><a href="#_4-下列关于http报文-说法错误的是-选择一项" class="header-anchor">#</a> 4.下列关于HTTP报文，说法错误的是？（选择一项）</h3> <p><strong>A.</strong> HTTP报文分为请求报文和响应报文</p> <p>**B.**请求报文分为请求头、请求体，请求头又分为起始行和首部</p> <p><strong>C.</strong> GET和POST请求都有请求头、请求体</p> <p>**D.**通过GET方法，发送的数据会在网址栏中体现出来</p> <p><strong>本题考查HTTP报文的相关概念。</strong></p> <p>GET 请求，没有请求体。所以C选项说法是错误的。</p> <p><strong>本题选择错误的项，答案为C。</strong></p> <h3 id="_5-下列关于http方法的语义-描述正确的选项是-选择两项"><a href="#_5-下列关于http方法的语义-描述正确的选项是-选择两项" class="header-anchor">#</a> 5.下列关于http方法的语义，描述正确的选项是？（选择两项）</h3> <p><strong>A.</strong> GET方法一般表示获取数据，例如：获取图片资源</p> <p>**B.**PUT方法一般表示添加数据，例如：注册时添加数据</p> <p><strong>C.</strong> POST方法一般表示更新数据，例如：修改个人信息</p> <p><strong>D.</strong> DELETE方法一般表示删除数据，例如：删除留言</p> <p><strong>本题主要考查http的几个常用方法。</strong></p> <p>GET方法表示互获取数据，A选项正确。</p> <p>PUT方法表示更新数据，B选项错误。</p> <p>POST方法表示创建数据，C选项错误。</p> <p>DELETE方法表示删除数据，D选项正确。</p> <p><strong>所以本题答案为AD.</strong></p> <h3 id="_6-关于get请求和post请求-下列说法错误的是-选择两项"><a href="#_6-关于get请求和post请求-下列说法错误的是-选择两项" class="header-anchor">#</a> 6.关于GET请求和POST请求，下列说法错误的是？（选择两项）</h3> <p><strong>A.</strong> GET请求不能通过请求体携带数据，但是可以通过请求头携带数据</p> <p>**B.**GET请求，可以在通过代码“xhr.send('sex=male')”，成功的发送数据</p> <p><strong>C.</strong> POST 请求主要通过请求体携带数据，不能通过请求头携带</p> <p><strong>D.</strong> POST请求可以通过“xhr.send(<code>username=${encodeURIComponent('张三')}</code>);”的形式发送数据。</p> <p><strong>本题考查GET请求与POST请求的区别。</strong></p> <p>GET请求不能通过请求体携带数据，但是可以通过请求头携带数据，A说法正确。</p> <p>send方法发送的数据，是通过请求体携带的，因此在get请求中，书写“xhr.send('sex=male')”这句代码，无法成功发送数据，B说法错误。</p> <p>POST请求，既可以通过请求体携带数据、又可以通过请求头携带数据，C说法错误。</p> <p>POST请求可以通过“xhr.send(<code>username=${encodeURIComponent('张三')}</code>);”的形式发送数据，D说法正确。</p> <p><strong>本题选择错误的说法，答案为BC。</strong></p> <h3 id="_7-下列关于常见的http状态码-描述正确的选项是-选择两项"><a href="#_7-下列关于常见的http状态码-描述正确的选项是-选择两项" class="header-anchor">#</a> 7.下列关于常见的HTTP状态码，描述正确的选项是？（选择两项）</h3> <p><strong>A.</strong> 状态码为200，表示请求成功</p> <p>**B.**状态码为302，表示永久重定向，重新跳转到其它网址</p> <p><strong>C.</strong> 状态码为404，表示找不到页面</p> <p><strong>D.</strong> 状态码为500，表示浏览器中的代码存在错误</p> <p><strong>本题主要考查常见的HTTP状态码的含义。</strong></p> <p>状态码为200，表示请求成功，A选项正确。</p> <p>状态码为301，表示永久重定向，302表示临时重定向，B选项错误。</p> <p>状态码为404，表示页面找不到。C选项正确。</p> <p>状态码为500，表示服务器端存在未知错误，与浏览器的代码没有任何关系，D选项错误。</p> <p><strong>所以本题答案为AC.</strong></p> <h3 id="_8-关于cookie-下列说法正确的是-选择两项"><a href="#_8-关于cookie-下列说法正确的是-选择两项" class="header-anchor">#</a> 8.关于cookie，下列说法正确的是？（选择两项）</h3> <p><strong>A.</strong> cookie是服务器端存储数据的一种方式</p> <p>**B.**浏览器在每次发送请求时，会自动把cookie发送到服务器端</p> <p><strong>C.</strong> 可以在cookie中保存密码等信息</p> <p><strong>D.</strong> 可以利用cookie，统计用户的访问习惯，比如用户什么时间段会访问网站</p> <p><strong>本题考查cookie的相关内容。</strong></p> <p>cookie是浏览器存储数据的一种方式，而不是服务器端，A说法错误。</p> <p>浏览器在每次发送请求时，会自动把cookie发送到服务器端，B说法正确。</p> <p>由于cookie可以被任何人查看，所以不要在cookie 中保存密码等敏感信息，C说法错误。</p> <p>cookie可以用来统计用户的访问习惯，D说法正确。</p> <p><strong>本题答案为BD。</strong></p> <h3 id="_9-关于cookie的使用-下列说法正确的是-选择两项"><a href="#_9-关于cookie的使用-下列说法正确的是-选择两项" class="header-anchor">#</a> 9.关于cookie的使用，下列说法正确的是？（选择两项）</h3> <p><strong>A.</strong> 利用document.cookie =&quot;age&quot;，可以写入一个cookie</p> <p><strong>B.</strong> 读取cookie，可以使用document.cookie</p> <p><strong>C.</strong> 可以使用“document.cookie = 'username=zs; age=18'”的形式批量设置cookie</p> <p><strong>D.</strong> document.cookie获取到的值，是名值对构成的字符串，例如：username=zs; age=18</p> <p><strong>本题考查cookie的设置与获取。</strong></p> <p>写入cookie，语法是：document.cookie = '键=值'，不能只写入键，A说法错误。</p> <p>document.cookie可以获取到cookie，B说法正确。</p> <p>设置多个cookie时，只能通过多次调用document.cookie = '键=值” 的方式逐个添加，无法批量添加，C说法错误。</p> <p>document.cookie是获取cookie，获取到的值，是名值对形式，D说法正确。</p> <p><strong>本题答案为BD。</strong></p> <h3 id="_10-下列代码中-可以正确设置两个cookie的失效时间为1天的选项是-选择一项"><a href="#_10-下列代码中-可以正确设置两个cookie的失效时间为1天的选项是-选择一项" class="header-anchor">#</a> 10.下列代码中，可以正确设置两个cookie的失效时间为1天的选项是？（选择一项）</h3> <p><strong>A.</strong> <a href="https://imgchr.com/i/rpUzdK" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/08/rpUzdK.png" alt="rpUzdK.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>B.</strong> <a href="https://imgchr.com/i/rpaPRH" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/08/rpaPRH.png" alt="rpaPRH.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>C.</strong> <a href="https://imgchr.com/i/rpaAsI" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/08/rpaAsI.png" alt="rpaAsI.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>D.</strong><a href="https://imgchr.com/i/rpaELt" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/08/rpaELt.png" alt="rpaELt.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>本题主要考查Cookie属性的设置。</strong></p> <p>Cookie的名值对不能一起设置，只能一个一个的设置。</p> <p>max-age属性的值为数字，表示当前时间+多少秒过期，单位是秒，1天对应的秒数是24 * 36000。</p> <p>设置Cookie的失效时间max-age属性要紧跟在名值对后面设置。A选项正确, C选项错误。</p> <p>BD选项代码中Cookie的名值对写在一起了，BD选项错误。</p> <p><strong>所以本题答案为A。</strong></p> <h3 id="_11-下列选项中-都是与cookie的属性相关的内容-说法错误的是-选择一项"><a href="#_11-下列选项中-都是与cookie的属性相关的内容-说法错误的是-选择一项" class="header-anchor">#</a> 11.下列选项中，都是与cookie的属性相关的内容，说法错误的是？（选择一项）</h3> <p><strong>A.</strong> 创建cookie时，必须设置名称和值两个属性</p> <p><strong>B.</strong> 如果cookie 的名称或值包含非英文字母，写入该cookie时无需处理</p> <p><strong>C.</strong> 可以使用Expires 或 Max-Age两个属性，为cookie设置失效时间</p> <p><strong>D.</strong> 没有设置失效时间的cookie称为会话cookie，浏览器关闭该cookie就会消失</p> <p><strong>本题考查cookie的相关属性。</strong></p> <p>名称（Name）和值（Value）是cookie最重要的两个属性，设置cookie时，必须设置这两个属性，A说法正确。</p> <p>Cookie的名称或值，如果包含非英文字母，写入该cookie时，需要使用encodeURIComponent() 编码，读取时使用decodeURIComponent() 解码，B说法错误。</p> <p>可以使用Expires或Max-Age两个属性，为cookie设置失效时间，C说法正确。</p> <p>没有设置失效时间的cookie，是会话cookie，关闭浏览器该cookie就会失效，D说法正确。</p> <p><strong>本题选择错误的项，答案为B。</strong></p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/./guide/notes/jswork/24-ES6测评题目.html" class="prev">
        24-ES6测评题目
      </a></span> <span class="next"><a href="/./guide/notes/jswork/26-ajax选择题.html">
        26-ajax选择题
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----><div class="reco-bgm-panel" data-v-b1d3339e><audio id="bgm" src="https://www.ytmp3.cn/down/75475.mp3" data-v-b1d3339e></audio> <div class="reco-float-box" style="bottom:30px;z-index:999999;display:none;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><img src="https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200" data-v-b1d3339e></div> <div class="reco-bgm-box" style="left:10px;bottom:10px;z-index:999999;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="reco-bgm-cover" style="background-image:url(https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200);" data-v-b1d3339e><div class="mini-operation" style="display:none;" data-v-b1d3339e><i class="reco-bgm reco-bgm-pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play" style="display:none;" data-v-b1d3339e></i></div> <div class="falut-message" style="display:none;" data-v-b1d3339e>
          播放失败
        </div></div> <div class="reco-bgm-info" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-music music" data-v-b1d3339e></i>花花公子</div> <div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-artist" data-v-b1d3339e></i>马思唯/step.jad</div> <div class="reco-bgm-progress" data-v-b1d3339e><div class="progress-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div> <div class="reco-bgm-operation" data-v-b1d3339e><i class="reco-bgm reco-bgm-last last" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-pause pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play play" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-next next" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-volume1 volume" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-mute mute" style="display:none;" data-v-b1d3339e></i> <div class="volume-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div></div> <div class="reco-bgm-left-box" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><i class="reco-bgm reco-bgm-left" data-v-b1d3339e></i></div></div></div></div></div>
    <script src="./assets/js/app.7878252f.js" defer></script><script src="./assets/js/2.877879cc.js" defer></script><script src="./assets/js/95.076b06fb.js" defer></script>
  </body>
</html>
